#!/bin/bash

for d in /home/mixagol/work/data/annotation_cluster/NC_*; do
    NEXT_CNT=$(ls $d/src_faa | wc -l)
    if [ -f $d/speed.dump ] ; then
        PREV_CNT=`cat $d/speed.dump | tail -n1 | cut -f2`
        DIFF_CNT=$(($PREV_CNT - $NEXT_CNT))
    else
        DIFF_CNT=0
    fi
    if [[ $NEXT_CNT -gt 0 ]] ; then
        echo -e $(date +%s)"\t"$NEXT_CNT"\t"$DIFF_CNT >> $d/speed.dump
    fi
done

